package com.omkarpatil.learningjpa2.mapping.manytomany.uni;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity(name = "MtmUniPost")
@Table(name = "mtm_uni_post")
public class Post implements Serializable {
	
	private int id;
	private String title;
	private String text;
 	
	public Post() {}

	public Post(String title, String text) {
		this.title = title;
		this.text = text;
	}

	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}

	private void setId(int id) {
		this.id = id;
	}

	@Column(nullable = false, length = 30)
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	@Column(nullable = false, length = 100)
	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}
}
